package com.foreknow.elm;

import com.foreknow.elm.po.OrderDetailet;

/**
 * @author shkstart
 * @create 2021-08-28 10:11
 */
public class Test {
    public static void main(String[] args) {
        /**
         * 功能：根据用户编号查询此用户所有购物车信息
         *   根据用户编号和商家编号，查询此用户购物车中某个商家的所有购物车信息
         */
        StringBuffer sql = new StringBuffer();
//        sql.append(" select c.*, ");
//        sql.append("        f.foodId ffoodId, ");
//        sql.append("        f.foodName ffoodName, ");
//        sql.append("        f.foodExplain ffoodExplain, ");
//        sql.append("        f.foodImg ffoodImg, ");
//        sql.append("        f.foodPrice ffoodPrice, ");
//        sql.append("        f.businessId fbusinessId, ");
//        sql.append("        f.remarks fremarks, ");
//        sql.append("        b.businessId bbusinessId, ");
//        sql.append("        b.businessName bbusinessName, ");
//        sql.append("        b.businessAddress bbusinessAddress, ");
//        sql.append("        b.businessExplain bbusinessExplain, ");
//        sql.append("        b.businessImg bbusinessImg, ");
//        sql.append("        b.orderTypeId borderTypeId, ");
//        sql.append("        b.starPrice bstarPrice, ");
//        sql.append("        b.deliveryPrice bdeliveryPrice");
//        sql.append(" from (cart c left join food f on c.foodId=f.foodId) ");
//        sql.append("      left join business b on c.businessId=b.businessId ");
//        sql.append("DELETE FROM cart");
//        sql.append("  where 1=1");
//            sql.append("  and userId="+ "11111111111");
//            sql.append("  and businessId="+10001);
//
//            sql.append("  and foodId="+1);

        sql.append("insert into orderdetailet (orderId,foodId,quantity) values");

            sql.append("( OdId() +od.getFoodId() od.getQuantity()");

        System.out.println(sql);
    }
}
